home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / internet / irc_i_dodatki / kuang / kuangeleven28.lha / Rexx / Connected.amirx < prev    next >
Text File  |  1997-04-01  |  2KB  |  84 lines

  1. /* Kuang Eleven v2.8 Init for AmIRC 1.22+ */
  2. scrpath='T:' /* Path of events handlers                              */
  3. /* Do not mess with anything below */
  4. x=getclip('st_init')
  5. if x==1|x=2 then exit
  6. setclip('st_init',2)
  7. options results
  8. cecho('Initializing')
  9. if ~show('L','rexxsupport.library') then if ~addlib('rexxsupport.library',0,-30,0) then do
  10.     cecho('Fatal Error: Cannot load rexxsupport.library')
  11.     exit
  12. end
  13. if ~show('L','rexxdossupport.library') then if ~addlib('rexxdossupport.library',0,-30,2) then do
  14.     cecho('Fatal Error: Cannot load rexxdossupport.library')
  15.     exit
  16. end
  17. putscript('kuang11.amirx')
  18. conf='Kuang11/Config'
  19. if open(1,conf,'R') then do
  20.     do until eof(1)
  21.         line=readln(1)
  22.         parse var line c a
  23.         if a~='' then setclip('sc_'||lower(strip(c)),strip(a))
  24.     end
  25.     close(1)
  26.     ou='SAY /HILITE'
  27.     x=getclip('sc_comprefix')
  28.     if x~='' then ou '"'||x||'"'
  29.     l=getclip('sc_swords')
  30.     if getclip('sc_shit')='ON'&l~='' then do i=1 to words(l);;ou '"'upper(word(l,i))'"';end
  31.     if getclip('sc_asound')='ON' then do
  32.         "GETMYNICK"
  33.         x=result
  34.         ou '"!'||x||'"'
  35.         setclip('st_asoundnick',x)
  36.     end
  37.     if getclip('sc_tia')='ON' then do
  38.         "GETMYNICK"
  39.         "USERHOST" result
  40.         host=result
  41.         open(1,'env:TIADCC','W')
  42.         rv=writeln(1,substr(host,pos('@',host)+1) 9050 9051 9052 9053)
  43.         close(1)
  44.     end
  45.     putlst=getclip('sc_copyscripts')
  46.     if putlst~='' then do until putlst=''
  47.         parse var putlst scr putlst
  48.         putscript(scr)
  49.     end
  50. end
  51. else cecho('Warning : Cannot load Configuration' conf)
  52.  
  53. flist=''
  54. if ~open(1,'Kuang11/friends','R') then flist='-'
  55. else do
  56.     do until eof(1)
  57.         x=readln(1)
  58.         flist=flist strip(word(x,1),'B','+') word(x,2) word(x,3)
  59.     end
  60.     close(1)
  61. end
  62. setclip('st_list',flist)
  63.  
  64. Setclip('st_version',version())
  65. Setclip('st_init',1)
  66. cecho(version() 'Initialized')
  67. 'SAY /RX kuang11cmd SHOW'
  68. exit
  69.  
  70. putscript:
  71. evn=scrpath||arg(1)
  72. if exists(evn) then address command 'delete' evn 'force quiet'
  73. address command 'copy rexx/'arg(1) evn 'quiet'
  74. address command 'protect' evn '-d'
  75. if ~exists(evn) then do
  76.     cecho('Failed! Missing' evn)
  77.     setclip('st_init')
  78.     exit
  79. end
  80. return 0
  81. version:;return x2c(2)'Kuang Eleven'x2c(2) 'v2.8'
  82. lower:;return translate(arg(1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')
  83. cecho:;"ECHO P="d2c(27)"b«KInit»" arg(1);return 0
  84.